package com.cooper.service.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cooper.dao.log.ResourceUsedDAO;
import com.cooper.entity.ResourceUsedEntity;

@Service
public class ResourceUsedService {
	
	@Autowired
	private ResourceUsedDAO resourceUsedDao;
	
	public Long saveEntity(ResourceUsedEntity entity) throws Exception{
		return this.resourceUsedDao.saveEntity(entity);
	}
	
	public long queryUsedCount(String origin) throws Exception{
		return this.resourceUsedDao.queryUsedCount(origin);
	}
	
	public boolean checkIfExists(String origin, String code) throws Exception{
		int count = this.resourceUsedDao.checkIfExists(origin, code);
		return count > 0;
	}

}
